|
In order to design
the GPIF waveform descriptors for this example, it is first important
to understand a little bit about how the TI DSP’s HPI protocol works.
Each HPI transfer is a two-byte sequence. The meaning of the first
byte and second byte depends on how the BOB bit is set in the DSP’s
HPIC register. In our example, the BOB bit is set to 1, which means
that the first byte of the HPI transfer is going to be the LSB and
the second byte of the transfer is going to be the MSB (as organized
in the DSP memory).
The example uses GPIF
single write transactions for writing to the HPIC and HPIA registers,
GPIF FIFO Write transactions for writing data into the HPI RAM,
and GPIF FIFO Read transactions for reading data from the HPI RAM.
Writing to the HPIC and HPIA registers is a special case that requires
two separate waveform behaviors to describe the entire HPI transfer.
One waveform behavior describes the timing and control logic for
the first byte of the HPI transfer, and another describes the timing
and control logic for the second byte of the HPI transfer.
In all of the GPIF
waveforms, CTL0-2 are manipulated according to the HPI protocol
and the HPI8 Mode Timing Requirements as outlined in the 5416 data
sheet. In the text to follow, we will discuss how CTL0-2 were manipulated
in the GPIF waveforms to describe the HPI protocol. Figure 23
shows the block diagram for the DSP example.
 Figure
23. GPIF Designer Block Diagram View
Figure 24,
below, shows waveform 0, which characterizes the behavior of the
waveform called SnglWr1. SnglWr1 describes the HPI protocol required
to write the first byte of an HPI transfer.
 Figure
24. SnglWr1 waveform in GPIF Designer
Since SnglWr1 describes
an HPI write operation, HR/W (CTL0) is held LOW throughout the entire
transfer (S0-S2). HBIL (CTL2) is dropped LOW in S0 to signify that
the first byte is being transferred. This is done before HDS1 (CTL1)
is asserted in S1, in order to satisfy the set-up time requirement
for HBIL before HDS1 can be made LOW. Since S0 is active for 20.83
ns (Wait 1 at 48-MHz IFCLK), this satisfies the set-up time requirement
of 6 ns for HBIL. Since there is also a hold time requirement for
HBIL, to simplify matters, HBIL is actually held LOW throughout
the active portion of the entire waveform.
By looking at the
HPI8 Timing Requirements in the 5416 data sheet, it becomes apparent
that any of the strobe widths or set-up and hold times are well
under 20.83 ns. Therefore, one can assume that a state need only
last at maximum 20.83 ns (Wait 1). In S1, data is also placed on
the bus (Activate Data). In S2, HDS1 is deasserted, thus ending
this portion of the HPI transfer. S2 also unconditionally branches
to the IDLE state to terminate the waveform.
The waveform that
describes the second portion of the HPI transfer is very similar
to SnglWr1, and is shown in Figure 25.
 Figure
25. SnglWr2 waveform in GPIF Designer
Again, since SnglWr2
also describes an HPI write operation, HR/W is held LOW throughout
the entire active portion of the waveform (S0–S2). The main difference
between SnglWr2 and SnglWr1 is the state of HBIL; HBIL is HIGH throughout
S0–S2. This signifies to the HPI that the second byte of the HPI
transfer is being transmitted. S2 unconditionally branches to the
IDLE state to terminate the waveform.
To recap, the SnglWr1
and SnglWr2 waveforms are used for GPIF single write accesses, which
allow us to write to the DSP’s HPIC/HPIA registers. The GPIF engine
allows you to select which of these waveforms are triggered by a
GPIF single write access, via the GPIFWFSELECT register. Consecutive
GPIF single write accesses using the waveforms SnglWr1 and SnglWr2
are made to describe the entire HPI transfer protocol. The details
of this are described in the firmware programming section (4.2.5).
To create the GPIF
FIFO read and write accesses that handle writing and reading to
and from the HPI data RAM, the attributes of the SnglWr1 and SnglWr2
waveforms can be combined to form each of the GPIF FIFO read and
write waveforms. Figure 26 shows the GPIF FIFO write waveform.
 Figure
26. FIFOWr waveform in GPIF Designer
Waveform 3 (FIFOWr)
describes an entire HPI write transfer. S0 drives both HR/W and
HBIL LOW for 20.83 ns, then S1 asserts HDS1 and drives the data
bus to present the first byte in the EP2 FIFO, effectively writing
out the first byte of the HPI transfer to the HPI RAM. S2 then increments
the FIFO pointer using Next FIFO data, deasserts HDS1, and drives
HBIL HIGH to tell the HPI the second byte of the transfer is coming.
S3 asserts HDS1 again and drives the data bus to present the second
byte in the EP2 FIFO, effectively writing out the second byte of
the HPI transfer to the HPI RAM.
The waveform then
traverses to S5, a decision point state that examines the GPIF TC
to determine whether or not to branch to the IDLE state. If the
GPIF TC has not yet expired, the waveform will then branch back
to S0 to actuate another HPI transfer. Otherwise, the waveform branches
to the IDLE state and terminates. The FIFO read waveform is quite
similar in nature and is shown in Figure 27.
 Figure
27. FIFORd waveform in GPIF Designer
Waveform 2 (FIFORd)
describes an entire HPI read transfer. HR/W is driven HIGH throughout
the waveform to tell the HPI that this is a read operation. In S0,
HBIL is driven LOW for 20.83 ns to satisfy the set-up time requirement
for HBIL, then S1 asserts HDS1, which tells the HPI to present the
first byte of the HPI read transfer onto the data bus. The data
is not presented until 10ns later, therefore it is correct to only
sample the databus in S2 and not in S1. By sampling the databus
in S2, the first byte is read into the FX2’s EP6 FIFO. For a GPIF
FIFO read transaction, an Activate Data also advances the FIFO pointer,
so a Next FIFO data is not necessary.
S2 also drives HBIL
HIGH to tell the HPI the second byte of the transfer is expected.
S3 asserts HDS1 again and S4 samples the data bus to read the second
byte into the EP6 FIFO.
The waveform then
traverses to S5, a decision point state that examines the GPIF TC
to determine whether or not to branch to the IDLE state. If the
GPIF TC has not yet expired, the waveform will then branch back
to S0 to actuate another HPI read transfer. Otherwise, the waveform
branches to the IDLE state and terminates.
Now that you understand
how the GPIF waveforms are programmed and set up for the DSP example,
the firmware programming can be discussed.
|